﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using NuMvvm.Messaging;
using System.Diagnostics;

namespace NuMvvm.Tests
{
    [TestFixture]
    public class ViewModelTest
    {
        [TestCase]
        public void TestCase1()
        {
            var messenger = Messenger.Default;

            TextMessage result = null;

            messenger.Subscribe<TextMessage>((message) =>
            {
                result = message;
            });

            var testViewModel = new PersonViewModel(messenger);
            testViewModel.Name = "Robert Sundström";
            testViewModel.Email = "robert.sundstrom@";

            var r = testViewModel.Validate();

            testViewModel.RegisterCommand.Execute(null);

            Assert.IsNotNull(result);

            Debug.WriteLine(result.Text);
        }
    }
}
